<?php
/*
 * @Author: CHINAKAIYUAN<sunkaiyuan@namenode.cn>
 * @Date: 2022-02-04 16:53:56
 * @LastEditTime: 2022-08-26 14:59:55
 * @LastEditors: CHINAKAIYUAN
 * @Description: 
 */

namespace App\Http\Services\System;


use App\Http\Services\Service;
use App\Repositories\TemporaryTokenRepository;

class TokenService extends Service
    {

    public function boot(TemporaryTokenRepository $repository)
        {
        $this->repository = $repository;
        }

    public function list()
        {
        $data = $this->repository->whereIs_system(1)->condition(request())->getGrid();
        return $data;
        }

    protected function delete()
        {
        return $this->repository->whereIn("id", $this->getRequestIds())->autodelete();
        }
    protected function create()
        {
        return $this->repository->createToken(0, "", "", -1, 1);
        }
    }
